import com.spi.test.Protocol;

import java.util.ServiceLoader;

/**
 * @author chenxin
 * @time 2016-12-17-08:55
 */
public class MainTest {
    public static void main(String[] args) {
        ServiceLoader<Protocol> serviceLoader = ServiceLoader.load(Protocol.class);

        Protocol one = serviceLoader.iterator().next();

        for (Protocol protocol : serviceLoader){
            System.out.println(protocol.getName());
        }

    }
}
